<?php

App::uses('CrudController', 'Controller');

class TransportRequestsController extends CrudController {
    public $_model = 'TransportRequest';

    public function index() {
        $appBosch = new stdClass();
        $this->set('appBosch', $appBosch);
        $this->set('title', __('Transporte'));
        $this->set('description', 'Solicitudes de transporte');
    }

    public function request($requestId) {
        $this->loadModel('TransportUser');
        $m = $this->_model;
        $appBosch = new stdClass();
        $appBosch->request = $this->$m->getEnabledById($requestId);
        $appBosch->request = $appBosch->request[0];
        $appBosch->users = $this->TransportUser->getEnabledByRequestId($requestId);
        $this->set('appBosch', $appBosch);
        $this->set('title', __('Solicitud'));
    }

    protected function getRecords($param)
    {
        $m = $this->_model;
        $records = $this->$m->getEnabled();
        return $records;
    }

    protected function c($model)
    {
        return array();
    }

    protected function u($model)
    {
        return array();
    }
}